isamuch - 2MA Cross and Stop Lossสัญญาณซื้อ/ขาย : มาจาก Moving Average สองเส้นตัดกัน
Stop Loss : มาจากราคาต่ำสุด/สูงสุดของช่วงระหว่าง Moving Average สองเส้นตัดกันก่อนหน้ากับ Moving Average ตัดกันปัจจุบัน
ค้นหาในสคริปต์สำหรับ "stop loss"
Parabolic SAR Strategy With take profit and stop lossDo not make it too difficult!
This is my first strategy! I took the Parabolic SAR Strategy and added Stop Loss and Take profit, and I can see some fantastic results in 2h-3h-4h on some of the Crypto coins.
This is for training only, and I do not recommend using it as part of a trading bot, however, I do myself.
MultiPrice AlertThis is an alert script using Pinescript version 4. This enables one to set 5 alerts (1 StopLoss, 4 Targets), on 3 different symbols, at using a single alert in the UI.
Every visible line will only appear on the symbols that are selected. After setting targets when making an alert, select this indicator as a condition. Change the name to whatever you want, usually the names of the set of tickers.
The Alert message is dyanmic showing which Symbol with each type of alert, at whatever price.
Ability to disable the targets + symbols.
Alerts work by Stop Loss crossing under price and Targets Cross Over. Enabling the "Short" Targets reverses this.
The line that is being displayed is actually the price of the asset being moved over x number of bars. I have not found a way to plot a traditional horizontal line, as the code for it uses a fixed price.
As it being a user input, it is a variable. Any help with this would be appreicated.
Alerts are set to once per bar.
Known bug that sometimes if the prices that you set are inside the current candle stick, then your alert will immeaditally fire, either change the timeframe or let it fire and wait fo
After a target is hit, I reccomend setting the alert to 0 and REMAKING the alert. You MUST REMAKE THE ALERT AFTER ANY CHANGES. This script WILL NOT CHANGE ALERTS AS YOU CHANGE SETTINGS.
TradingView Alerts are not this smart , at least I haven't found a way to do this yet.
Anti-Volume Stop Loss multi timeframe [LM]Hello Traders,
I would like to introduce you fork of popular indicator Anti-Volume Stop Loss created by Buff Dormeier and cracked here on tradingview by @Rafka so shout out to him. I have tried to crack it myself as well as I'm big fan of Dormeier's work but it's not easy so really big thanks to Rafka
I have refactored original script and have included multi timeframe setting.
As its shown below you can select higher timeframe to track lower one:
Enjoy!
Bitlinc MARSI Study AST w/ Take Profit & Stop loss - beta 0.1This script is beta 0.1 - will update as soon as the script is tradable
This script is based on AST on a 10 minute timeframe. You can change the asset and the timeframe for any asset you want to trade, but for it to work correct ALL settings have to be testes in the Strategy section of the TradingView. Each assets and timeframe require a different mixture of settings. This is NOT a one settings fits all trading for all assets on any timeframe. Below are the settings and explanation on how it works.
How it fires a buy / sell:
The script will plot an RSI with upper and lower bands in a separate indicator window. The idea behind this script is to fire a LONG when MA crosses OVER lower band and fire a SHORT when the MA crosses under the lower band. Each order that fires is an OCO (Order Cancels Order) for pyramiding.
Settings:
You have full control of these settings as mentioned above, you must configure every part of this script for each asset and timeframe you trade.
- Length of MA
- Length
- Upper bands of RSI
- Lower bands of RSI
- Take profit percentage
- Stop loss percentage
- Month to start and end the strategy (within 2020)
- Day to start and end the strategy (within 2020)
- Quantity type
- Slippage
- Pyramiding
***Remember that after the signal to enter or exit a trade is fired, the alert will trigger AFTER the close of the candle that caused the tigger to fire
ATR Stop Loss LONG/SHORT by melihgulerYou can monitor the stop loss level according to ATR in 2 ways (Long/Short).
RSI + EMA+ MTF Stop-LossThis is a simple RSI with multiple MTF (No security) to help with direction short and long-term.
The rsi for the current chart has a noise reduction, while the rest are based on ma's.
I have supplied an extra flexible mtf rsi ma for potential adjustable/long-term stop-loss or direction identification.
Enjoy
RSI Stop LossExperiment for using RSI as a stop loss value, shows where the price will be when the RSI increases or decreases by a specified amount.
poki buy and sell Take profit and stop lossThis indicator is based on modelius model of lazy bear weis model with ATR for the buy=B sell =S
in addition there is Take profit and stop loss in % both for short and for long
next stage is to know the resistance level and support based on bollinger marked in blue and red dots
Also included Parabolic Sar (blue and red dots rising up or down)
The color of bulish or bearish zone is based on the cross of Hull avreage and linear regression ( for each time set may need different setting for accuracy )
So how to use this scrupt to better profit
1. if you have B signal and its on lower support level then its good starting place for buy. look at the Parabolic Sar if its in agreement. The exit can be either by S =sell, Take profit that you decide on % or by end of Parabolic SAR upward
2. exact the oposite for short
Play with setting for the desired results or change modify this script for your purpose
Pivot Stop LossHere we intend to use pivot points for stop loss and take profit. This has the added benefit of helping you to visualize support and resistance levels.
Hull modelius take profit and stop lossThis model has Hull moving average, fibs in form of Bollinger ,SMA and Modelius model with ATR for buy and sell power based on weis volume. Inside alerts for buy and sell. take profit and stop loss for both longs and shorts
so have fun
SL + TP Dynamics - By M.LolasStop Loss e Take Profit dinâmicos para operações semiautomatizadas.
By M.Lolas
STOP-LOSS-RSI with Edge-Preserving Filter Strategy V2Modified RSI strategy with entry and exit points.
I have allowed for High and Low risk for anyone interested in using it (NO GUARANTEES. DO YOUR OWN RESEARCH).
I will later consider incorporating the standard RSI for exit points. I am sure returns will increase based on current test runs :)
Returns look good based on the strategy result.
PA SystemPA System - Price Action Trading System
价格行为交易系统
📊 概述 / Overview
PA System is a comprehensive price action trading indicator that combines Smart Money Concepts (SMC), market structure analysis, and multi-timeframe confirmation to identify high-probability trade setups. Designed for both manual traders and algorithmic trading systems.
PA System 是一个综合性价格行为交易指标,结合了Smart Money概念(SMC)、市场结构分析和多时间框架确认,用于识别高概率交易机会。适用于手动交易者和算法交易系统。
✨ 核心特性 / Key Features
🎯 Four-Phase Signal System / 四阶段信号系统
H1 (First Pullback) - Initial bullish retracement in uptrend
H2 (Confirmed Entry) - Breakout confirmation for long entries
L1 (First Bounce) - Initial bearish bounce in downtrend
L2 (Confirmed Entry) - Breakdown confirmation for short entries
中文说明:
H1(首次回调) - 上升趋势中的初次回撤信号
H2(确认入场) - 突破确认的做多入场点
L1(首次反弹) - 下降趋势中的初次反弹信号
L2(确认入场) - 跌破确认的做空入场点
📐 Market Structure Detection / 市场结构识别
HH (Higher High) - Uptrend confirmation / 上升趋势确认
HL (Higher Low) - Bullish pullback / 多头回调
LH (Lower High) - Bearish bounce / 空头反弹
LL (Lower Low) - Downtrend confirmation / 下降趋势确认
💎 Smart Money Concepts (SMC) / 智能资金概念
BoS (Break of Structure) - Trend continuation signal / 趋势延续信号
CHoCH (Change of Character) - Potential trend reversal / 潜在趋势反转
📈 Dynamic Trendlines / 动态趋势线
Auto-drawn support and resistance trendlines / 自动绘制支撑阻力趋势线
Real-time extension to current bar / 实时延伸至当前K线
Slope-filtered for accuracy / 斜率过滤确保准确性
🎚️ Multi-Timeframe Analysis / 多时间框架分析
Higher timeframe trend filter (default 4H) / 大周期趋势过滤(默认4小时)
Prevents counter-trend trades / 防止逆势交易
Configurable timeframe / 可配置时间周期
📊 Volume Confirmation / 成交量确认
Filters signals based on volume strength / 基于成交量强度过滤信号
20-period volume MA comparison / 与20期成交量均线对比
High-volume bars highlighted / 高成交量K线高亮显示
🎯 Risk Management Tools / 风险管理工具
Automatic SL/TP calculation and display / 自动计算并显示止损止盈
Visual stop loss and take profit lines / 可视化止损止盈线条
Risk percentage and R:R ratio display / 显示风险百分比和盈亏比
Dynamic stop loss sizing (0.3% - 1.5%) / 动态止损范围(0.3% - 1.5%)
📱 Real-Time Alerts / 实时警报
Instant notifications on H2/L2 signals / H2/L2信号即时通知
Webhook support for automation / 支持Webhook自动化
Mobile, email, and popup alerts / 手机、邮件和弹窗警报
📊 Professional Dashboard / 专业仪表盘
Real-time market state (CHANNEL/RANGE/BREAKOUT) / 实时市场状态
Local and MTF trend indicators / 本地及大周期趋势指标
Order flow status (HIGH VOL / LOW VOL) / 订单流状态
Last signal tracker / 最新信号追踪
🔧 参数设置 / Parameter Settings
Structure Settings / 结构设置
Parameter Default Range Description
Swing Length / 摆动长度 5 2-20 Pivot detection sensitivity / 枢轴点检测灵敏度
Trend Confirm Bars / 趋势确认根数 3 2-10 Consecutive bars for breakout / 突破所需连续K线数
Channel ATR Mult / 通道ATR倍数 2.0 1.0-5.0 Range detection threshold / 区间检测阈值
Signal Settings / 信号设置
Parameter Default Description
Enable H2 Longs / 启用H2做多 ✅ Toggle long signals / 开关做多信号
Enable L2 Shorts / 启用L2做空 ✅ Toggle short signals / 开关做空信号
Micro Range Length / 微平台长度 3 Breakout detection bars / 突破检测K线数
Close Strength / 收盘强度 0.6 Minimum close position in bar / K线内最小收盘位置
Filter Settings / 过滤设置
Parameter Default Description
Use MTF Filter / 大周期过滤 ✅ Enable higher timeframe filter / 启用大周期过滤
MTF Timeframe / 大周期时间框架 240 (4H) Higher timeframe period / 大周期时间
Use Volume Filter / 成交量过滤 ✅ Require high volume confirmation / 需要高成交量确认
Volume MA Length / 成交量均线周期 20 Volume comparison period / 成交量对比周期
Fast EMA / 快速EMA 20 Short-term trend / 短期趋势
Slow EMA / 慢速EMA 50 Long-term trend / 长期趋势
Risk Management / 风险管理
Parameter Default Description
Risk % / 风险百分比 1.0% Risk per trade / 每笔交易风险
R:R Ratio / 盈亏比 2.0 Reward to risk ratio / 盈亏比率
Max SL ATR / 最大止损ATR 3.0 Maximum stop loss in ATR / 最大止损ATR倍数
Min SL % / 最小止损百分比 0.3% Minimum stop loss percentage / 最小止损百分比
Max SL % / 最大止损百分比 1.5% Maximum stop loss percentage / 最大止损百分比
📖 使用方法 / How to Use
1. 基础设置 / Basic Setup
For Day Trading (5-15 min charts) / 日内交易(5-15分钟图)
text
Swing Length: 5
MTF Timeframe: 240 (4H)
Risk %: 1.0%
R:R: 2.0
For Swing Trading (1-4H charts) / 波段交易(1-4小时图)
text
Swing Length: 8
MTF Timeframe: D (Daily)
Risk %: 0.5%
R:R: 3.0
For Scalping (1-5 min charts) / 剥头皮(1-5分钟图)
text
Swing Length: 3
MTF Timeframe: 60 (1H)
Risk %: 0.5%
R:R: 1.5
Use Volume Filter: ✅
2. 信号识别 / Signal Identification
Long Entry / 做多入场
✅ Dashboard shows "Local Trend: BULL" / 仪表盘显示"本地趋势:多头"
✅ MTF Trend shows "BULLISH" / 大周期趋势显示"看涨"
✅ Green circle (H1) appears below bar / 绿色圆点(H1)出现在K线下方
⏳ Wait for H2 signal (green triangle ▲) / 等待H2信号(绿色三角▲)
📊 Check volume bar is cyan (HIGH VOL) / 检查成交量柱为青色(高成交量)
🎯 Enter at close of H2 bar / 在H2 K线收盘价入场
🛡️ Set SL at red dashed line / 止损设在红色虚线位置
🎁 Set TP at green dashed line / 止盈设在绿色虚线位置
Short Entry / 做空入场
✅ Dashboard shows "Local Trend: BEAR" / 仪表盘显示"本地趋势:空头"
✅ MTF Trend shows "BEARISH" / 大周期趋势显示"看跌"
✅ Red circle (L1) appears above bar / 红色圆点(L1)出现在K线上方
⏳ Wait for L2 signal (red triangle ▼) / 等待L2信号(红色倒三角▼)
📊 Check volume bar is cyan (HIGH VOL) / 检查成交量柱为青色(高成交量)
🎯 Enter at close of L2 bar / 在L2 K线收盘价入场
🛡️ Set SL at red dashed line / 止损设在红色虚线位置
🎁 Set TP at green dashed line / 止盈设在绿色虚线位置
3. 警报设置 / Alert Setup
Step-by-Step / 分步操作
Click the "⏰" alert icon on chart / 点击图表上的"⏰"警报图标
Select "PA System - Indicator Version" / 选择"PA System (V1.1) - Indicator Version"
Condition: "Any alert() function call" / 条件:选择"Any alert() function call"
Choose notification method: / 选择通知方式:
📱 Mobile Push / 手机推送
📧 Email / 邮件
🔗 Webhook URL (for automation) / Webhook网址(用于自动化)
Set frequency: "Once Per Bar Close" / 频率:选择"Once Per Bar Close"
Click "Create" / 点击"创建"
Webhook Example for IBKR API / IBKR API的Webhook示例
json
{
"signal": "{{strategy.order.action}}",
"ticker": "{{ticker}}",
"entry": {{close}},
"stop_loss": {{plot_0}},
"take_profit": {{plot_1}},
"timestamp": "{{timenow}}"
}
4. 交易管理 / Trade Management
Position Sizing / 仓位计算
text
Account: $10,000
Risk per Trade: 1% = $100
Entry Price: $690.45
Stop Loss: $687.38
Risk per Share: $690.45 - $687.38 = $3.07
Position Size: $100 / $3.07 = 32 shares
Partial Profit Taking / 部分止盈
Close 50% position at 1:1 R:R / 在1:1盈亏比时平仓50%
Move SL to breakeven / 移动止损至保本位
Let remaining 50% run to 2R target / 让剩余50%跑向2R目标
🎨 视觉元素说明 / Visual Elements Guide
Chart Markers / 图表标记
Symbol Color Meaning
⚫ Small Circle / 小圆点 🟢 Green / 绿色 H1 - First bullish pullback / 首次多头回调
▲ Triangle / 三角形 🟢 Green / 绿色 H2 - Confirmed long entry / 确认做多入场
⚫ Small Circle / 小圆点 🔴 Red / 红色 L1 - First bearish bounce / 首次空头反弹
▼ Inverted Triangle / 倒三角 🔴 Red / 红色 L2 - Confirmed short entry / 确认做空入场
Structure Labels / 结构标签
Label Position Meaning
HH Above high / 高点上方 Higher High - Bullish / 更高的高点-看涨
HL Below low / 低点下方 Higher Low - Bullish / 更高的低点-看涨
LH Above high / 高点上方 Lower High - Bearish / 更低的高点-看跌
LL Below low / 低点下方 Lower Low - Bearish / 更低的低点-看跌
BoS/CHoCH Lines / 破位线条
Type Color Width Meaning
BoS 🔵 Teal / 青色 2px Break of Structure - Trend continues / 结构突破-趋势延续
CHoCH 🔴 Red / 红色 2px Change of Character - Trend reversal / 性质改变-趋势反转
Trendlines / 趋势线
Type Color Style Meaning
Bullish / 看涨 🔵 Teal / 青色 Solid / 实线 Uptrend support / 上升趋势支撑
Bearish / 看跌 🔴 Red / 红色 Solid / 实线 Downtrend resistance / 下降趋势阻力
Risk Lines / 风险线条
Type Color Style Meaning
Stop Loss / 止损 🔴 Red / 红色 Dashed / 虚线 Suggested stop loss level / 建议止损位
Take Profit / 止盈 🟢 Green / 绿色 Dashed / 虚线 Suggested take profit level / 建议止盈位
Dashboard Colors / 仪表盘颜色
Status Color Meaning
BULL / 多头 🟢 Green / 绿色 Bullish trend / 看涨趋势
BEAR / 空头 🔴 Red / 红色 Bearish trend / 看跌趋势
NEUTRAL / 中性 ⚪ Gray / 灰色 No clear trend / 无明确趋势
BREAKOUT / 突破 🟡 Lime / 黄绿 Strong momentum / 强劲动能
HIGH VOL / 高成交量 🔵 Cyan / 青色 High volume confirmation / 高成交量确认
💡 交易策略建议 / Trading Strategy Tips
✅ High Probability Setups / 高概率设置
Trend Alignment / 趋势一致
Local Trend = BULL + MTF Trend = BULLISH / 本地多头 + 大周期看涨
Or: Local Trend = BEAR + MTF Trend = BEARISH / 或:本地空头 + 大周期看跌
Volume Confirmation / 成交量确认
H2/L2 signal appears with cyan volume bar / H2/L2信号伴随青色成交量柱
Volume > 20-period MA / 成交量 > 20期均线
Trendline Support / 趋势线支撑
H2 appears near bullish trendline / H2出现在看涨趋势线附近
L2 appears near bearish trendline / L2出现在看跌趋势线附近
BoS Confirmation / BoS确认
Recent BoS in same direction / 最近同方向的BoS
No CHoCH against the trade / 无逆向的CHoCH
❌ Avoid These Setups / 避免这些情况
Conflicting Trends / 趋势冲突
Local BULL but MTF BEARISH / 本地多头但大周期看跌
Market State = RANGE / 市场状态 = 区间
Low Volume / 低成交量
Order Flow shows "LOW VOL" / 订单流显示"低成交量"
Volume bar is red (below MA) / 成交量柱为红色(低于均线)
Against Trendline / 逆趋势线
Shorting at bullish trendline support / 在看涨趋势线支撑处做空
Buying at bearish trendline resistance / 在看跌趋势线阻力处做多
Recent CHoCH / 近期CHoCH
CHoCH appeared within 10 bars / 10根K线内出现CHoCH
Potential trend reversal zone / 潜在趋势反转区域
🔄 优化建议 / Optimization Tips
For Different Markets / 针对不同市场
Stocks / 股票
text
Swing Length: 5-8
MTF: 240 (4H) or D (Daily)
Risk %: 0.5-1.0%
Best on: SPY, QQQ, AAPL, TSLA
Forex / 外汇
text
Swing Length: 5
MTF: 240 (4H)
Risk %: 1.0-2.0%
Best on: EUR/USD, GBP/USD, USD/JPY
Use Volume Filter: OFF (Forex volume is unreliable)
Crypto / 加密货币
text
Swing Length: 3-5
MTF: 240 (4H)
Risk %: 0.5-1.0% (high volatility)
Max SL %: 2.0-3.0%
Best on: BTC, ETH, SOL
Futures / 期货
text
Swing Length: 5
MTF: 240 (4H)
Risk %: 1.0-1.5%
Best on: ES, NQ, RTY, CL
🤖 自动化集成 / Automation Integration
Python + IBKR API Example / Python + IBKR API示例
python
import requests
from ib_insync import *
def handle_tradingview_alert(alert_data):
"""
Receives webhook from TradingView alert
接收来自TradingView警报的webhook
"""
signal = alert_data # "H2 LONG" or "L2 SHORT"
ticker = alert_data # "SPY"
entry = alert_data # 690.45
stop_loss = alert_data # 687.38
take_profit = alert_data # 696.59
# Connect to IBKR
ib = IB()
ib.connect('127.0.0.1', 7497, clientId=1)
# Create contract
contract = Stock(ticker, 'SMART', 'USD')
# Calculate position size (1% risk)
account_value = ib.accountValues() .value
risk_amount = float(account_value) * 0.01
risk_per_share = abs(entry - stop_loss)
quantity = int(risk_amount / risk_per_share)
# Place order
if "LONG" in signal:
order = MarketOrder('BUY', quantity)
else:
order = MarketOrder('SELL', quantity)
trade = ib.placeOrder(contract, order)
# Set stop loss and take profit
ib.placeOrder(contract, StopOrder('SELL', quantity, stop_loss))
ib.placeOrder(contract, LimitOrder('SELL', quantity, take_profit))
ib.disconnect()
TradersPost Integration / TradersPost集成
Create TradersPost account / 创建TradersPost账户
Connect IBKR broker / 连接IBKR券商
Get Webhook URL / 获取Webhook网址
Add to TradingView alert / 添加到TradingView警报
Test with paper trading / 用模拟账户测试
📊 性能指标 / Performance Metrics
Expected Performance (Backtested) / 预期表现(回测)
Metric Value Notes
Win Rate / 胜率 60-75% With all filters enabled / 启用所有过滤器
Avg R:R / 平均盈亏比 1.8-2.2 Using 2R target / 使用2R目标
Max Drawdown / 最大回撤 8-12% 1% risk per trade / 每笔1%风险
Profit Factor / 盈利因子 1.8-2.5 Trend-following bias / 趋势跟随偏向
Best Markets / 最佳市场 Trending Avoid ranging markets / 避免区间市场
⚠️ Disclaimer: Past performance does not guarantee future results. Always test in paper trading first.
⚠️ 免责声明:历史表现不保证未来结果。请先在模拟账户测试。
🛠️ 故障排除 / Troubleshooting
Problem: No signals appearing / 问题:没有信号出现
Solution / 解决方案:
Disable MTF Filter temporarily / 暂时关闭大周期过滤
Disable Volume Filter / 关闭成交量过滤
Reduce Swing Length to 3 / 将摆动长度降至3
Check if market is ranging (no clear trend) / 检查市场是否处于区间(无明确趋势)
Problem: Too many signals / 问题:信号太多
Solution / 解决方案:
Enable MTF Filter / 启用大周期过滤
Enable Volume Filter / 启用成交量过滤
Increase Swing Length to 8 / 将摆动长度增至8
Enable Break Filter / 启用破位过滤
Problem: Alerts not working / 问题:警报不工作
Solution / 解决方案:
Check "Enable Alerts" is ON / 检查"启用警报"已开启
Verify alert condition is "Any alert() function call" / 确认警报条件为"Any alert() function call"
Check notification settings in TradingView / 检查TradingView通知设置
Test alert with "Test" button / 用"测试"按钮测试警报
Problem: SL/TP lines not showing / 问题:止损止盈线不显示
Solution / 解决方案:
Enable "Show SL/TP Labels" in settings / 在设置中启用"显示止损止盈标签"
Check if signal is recent (lines expire after 10 bars) / 检查信号是否近期(线条在10根K线后消失)
Zoom in to see lines more clearly / 放大图表以更清楚地看到线条
📚 常见问题 FAQ
Q1: Can I use this on any timeframe? / 可以在任何时间框架使用吗?
A: Yes, but works best on 5min-4H charts. Recommended: 15min (day trading), 1H (swing trading).
可以,但在5分钟-4小时图表效果最佳。推荐:15分钟(日内交易),1小时(波段交易)。
Q2: Do I need to enable all filters? / 需要启用所有过滤器吗?
A: No. Start with all enabled, then disable based on your risk tolerance. MTF filter is highly recommended.
不需要。从全部启用开始,然后根据风险承受能力禁用。强烈推荐MTF过滤器。
Q3: Can I automate this with IBKR? / 可以与IBKR自动化吗?
A: Yes! Use TradingView alerts + Webhook + Python script + IBKR API. See automation example above.
可以!使用TradingView警报 + Webhook + Python脚本 + IBKR API。参见上方自动化示例。
Q4: What's the difference between Strategy and Indicator version? / 策略版和指标版有什么区别?
A: Strategy = backtesting only. Indicator = real-time alerts + automation. Use both: backtest with strategy, trade with indicator.
策略版=仅回测。指标版=实时警报+自动化。两者结合使用:用策略版回测,用指标版交易。
Q5: Why does H2 appear but no trade? / 为什么出现H2但没有交易?
A: This is an indicator, not a strategy. You need to manually place orders or use automation via alerts.
这是指标,不是策略。你需要手动下单或通过警报使用自动化。
⚖️ 免责声明 / Disclaimer
IMPORTANT / 重要提示:
This indicator is for educational purposes only. Trading involves substantial risk of loss. Past performance does not guarantee future results. Always:
本指标仅供教育目的。交易涉及重大亏损风险。历史表现不保证未来结果。请务必:
✅ Test in paper trading first / 先在模拟账户测试
✅ Use proper risk management (1-2% max per trade) / 使用适当风险管理(每笔最多1-2%)
✅ Never risk more than you can afford to lose / 永远不要冒超出承受能力的风险
✅ Understand the strategy before using / 使用前理解策略原理
Not financial advice. Trade at your own risk.
非投资建议。交易风险自负。
MTF EMA50/200 // ADX (Auto TF Pairing) with SL/TP // v6Strategy overview (EMA50/EMA200 + ADX, multi-timeframe):
This system trades only in the direction of the higher-timeframe trend and uses the current chart timeframe for precise entries.
Trend filter (Higher TF):
Bull trend: EMA50 > EMA200 and ADX ≥ threshold → only LONGs allowed
Bear trend: EMA50 < EMA200 and ADX ≥ threshold → only SHORTs allowed
If ADX is below the “no-trend” threshold, the market is considered choppy and trades are avoided.
Entry (Lower TF / chart TF):
Enter only when the chart timeframe confirms momentum in the HTF direction using one of:
Touch: price pulls back to EMA50 and closes back on the trend side
Rejection: stricter “touch + reject” near EMA50
Cross: close crosses EMA50 in the trend direction
Stop Loss (structure + volatility):
LONG: below the safer of last swing low or EMA50, minus an ATR buffer
SHORT: above the safer of last swing high or EMA50, plus an ATR buffer
Take Profit (risk-based):
Targets are set as multiples of risk (R) from entry:
TP1 = 2R (default)
TP2 = 3R (optional)
The indicator plots only the latest trade’s Entry (black line), Stop (red dashed), and TP (green dashed), and it auto-pairs the chart timeframe with a “next level up” higher timeframe for the trend filter.
TradingView.To Strategy Template (with Dyanmic Alerts)Hello traders,
If you're tired of manual trading and looking for a solid strategy template to pair with your indicators, look no further.
This Pine Script v5 strategy template is engineered for maximum customization and risk management.
Best part?
This Pine Script v5 template facilitates the dynamic construction of TradingView.TO alerts, sparing users the time and effort of mastering the TradingView.TO syntax and manually create alert commands.
This powerful tool gives much power to those who don't know how to code in Pinescript and want to automate their indicators' signals via TradingView.TO bot.
IMPORTANT NOTES
TradingView.TO is a trading bot software that forwards TradingView alerts to your brokers (examples: Binance, Oanda, Coinbase, Bybit, Metatrader 4/5, ...) for automating trading.
Many traders don't know how to create TradingView.TO dynamically-compatible alerts using the data from their TradingView scripts.
Traders using trading bots want their alerts to reflect the stop-loss/take-profit/trailing-stop/stop-loss to break options from your script and then create the orders accordingly.
This script showcases how to create TradingView.TO alerts dynamically.
TRADINGVIEW ALERTS
1) You'll have to create one alert per asset X timeframe = 1 chart.
Example: 1 alert for BTC/USDT on the 5 minutes chart, 1 alert for BTC/USDT on the 15-minute chart (assuming you want your bot to trade the BTC/USDT on the 5 and 15-minute timeframes)
2) Select the Order fills and alert() function calls condition
3) For each alert, the alert message is pre-configured with the text below
{{strategy.order.alert_message}}
Please leave it as it is.
It's a TradingView native variable that will fetch the alert text messages built by the script.
4) TradingView.TO uses webhook technology - setting a webhook URL from the alerts notifications tab is required.
KEY FEATURES
I) Modular Indicator Connection
* plug your existing indicator into the template.
* Only two lines of code are needed for full compatibility.
Step 1: Create your connector
Adapt your indicator with only 2 lines of code and then connect it to this strategy template.
To do so:
1) Find in your indicator where the conditions print the long/buy and short/sell signals.
2) Create an additional plot as below
I'm giving an example with a Two moving averages cross.
Please replicate the same methodology for your indicator, whether a MACD , ZigZag, Pivots , higher-highs, lower-lows or whatever indicator with clear buy and sell conditions.
//@version=5
indicator("Supertrend", overlay = true, timeframe = "", timeframe_gaps = true)
atrPeriod = input.int(10, "ATR Length", minval = 1)
factor = input.float(3.0, "Factor", minval = 0.01, step = 0.01)
= ta.supertrend(factor, atrPeriod)
supertrend := barstate.isfirst ? na : supertrend
bodyMiddle = plot(barstate.isfirst ? na : (open + close) / 2, display = display.none)
upTrend = plot(direction < 0 ? supertrend : na, "Up Trend", color = color.green, style = plot.style_linebr)
downTrend = plot(direction < 0 ? na : supertrend, "Down Trend", color = color.red, style = plot.style_linebr)
fill(bodyMiddle, upTrend, color.new(color.green, 90), fillgaps = false)
fill(bodyMiddle, downTrend, color.new(color.red, 90), fillgaps = false)
buy = ta.crossunder(direction, 0)
sell = ta.crossunder(direction, 0)
//////// CONNECTOR SECTION ////////
Signal = buy ? 1 : sell ? -1 : 0
plot(Signal, title = "Signal", display = display.data_window)
//////// CONNECTOR SECTION ////////
Important Notes
🔥 The Strategy Template expects the value to be exactly 1 for the bullish signal and -1 for the bearish signal
Now, you can connect your indicator to the Strategy Template using the method below or that one.
Step 2: Connect the connector
1) Add your updated indicator to a TradingView chart
2) Add the Strategy Template as well to the SAME chart
3) Open the Strategy Template settings, and in the Data Source field, select your 🔌Connector🔌 (which comes from your indicator)
Note it doesn’t have to be named 🔌Connector🔌 - you can name it as you want - however, I recommend an explicit name you can easily remember.
From then, you should start seeing the signals and plenty of other stuff on your chart.
🔥 Note that whenever you update your indicator values, the strategy statistics and visuals on your chart will update in real-time
II) BOT Risk Management:
- Max Drawdown:
Mode: Select whether the max drawdown is calculated in percentage (%) or USD.
Value: If the max drawdown reaches this specified value, set a value to halt the bot.
- Max Consecutive Days:
Use Max Consecutive Days BOT Halt: Enable/Disable halting the bot if the max consecutive losing days value is reached.
- Max Consecutive Days: Set the maximum number of consecutive losing days allowed before halting the bot.
- Max Losing Streak:
Use Max Losing Streak: Enable/Disable a feature to prevent the bot from taking too many losses in a row.
- Max Losing Streak Length: Set the maximum length of a losing streak allowed.
Margin Call:
- Use Margin Call: Enable/Disable a feature to exit when a specified percentage away from a margin call to prevent it.
Margin Call (%): Set the percentage value to trigger this feature.
- Close BOT Total Loss:
Use Close BOT Total Loss: Enable/Disable a feature to close all trades and halt the bot if the total loss is reached.
- Total Loss ($): Set the total loss value in USD to trigger this feature.
Intraday BOT Risk Management:
- Intraday Losses:
Use Intraday Losses BOT Halt: Enable/Disable halting the bot on reaching specified intraday losses.
Mode: Select whether the intraday loss is calculated in percentage (%) or USD.
- Max Intraday Losses (%): Set the value for maximum intraday losses.
Limit Intraday Trades:
- Use Limit Intraday Trades: Enable/Disable a feature to limit the number of intraday trades.
- Max Intraday Trades: Set the maximum number of intraday trades allowed.
Restart Intraday EA:
III) Order Types and Position Sizing
- Choose between market or limit orders.
- Set your position size directly in the template.
Please use the position size from the “Inputs” and not the “Properties” tab.
I know it's redundant. - the template needs this value from the "Inputs" tab to build the alerts, and the Backtester needs it from the "Properties" tab.
IV) Advanced Take-Profit and Stop-Loss Options
- Choose to set your SL/TP in either USD or percentages.
- Option for multiple take-profit levels and trailing stop losses.
- Move your stop loss to break even +/- offset in USD for “risk-free” trades.
V) Miscellaneous:
Retry order openings if they fail.
Order Types:
Select and specify order type and price settings.
Position Size:
Define the type and size of positions.
Leverage:
Leverage settings, including margin type and hedge mode.
Session:
Limit trades to specific sessions.
Dates:
Limit trades to a specific date range.
Trades Direction:
Direction: Specify the market direction for opening positions.
VI) Logger
The TradingView.TO commands are logged in the TradingView logger.
You'll find more information about it in this TradingView blog post .
WHY YOU MIGHT NEED THIS TEMPLATE
1) Transform your indicator into a TradingView.TO trading bot more easily than before
Connect your indicator to the template
Create your alerts
Set your EA settings
2) Save Time
Auto-generated alert messages for TradingView.TO.
I tested them all and checked with the support team what could/couldn’t be done.
3) Be in Control
Manage your trading risks with advanced features.
4) Customizable
Fits various trading styles and asset classes.
REQUIREMENTS
* Make sure you have your TradingView.TO account
* If there is any issue with the template, ask me in the comments section - I’ll answer quickly.
BACKTEST RESULTS FROM THIS POST
1) I connected this strategy template to a dummy Supertrend script.
I could have selected any other indicator or concept for this script post.
I wanted to share an example of how you can quickly upgrade your strategy, making it compatible with TradingView.TO.
2) The backtest results aren't relevant for this educational script publication.
I used realistic backtesting data but didn't look too much into optimizing the results, as this isn't the point of why I'm publishing this script.
This strategy is a template to be connected to any indicator - the sky is the limit. :)
3) This template is made to take 1 trade per direction at any given time.
Pyramiding is set to 1 on TradingView.
The strategy default settings are:
* Initial Capital: 100000 USD
* Position Size: 1%
* Commission Percent: 0.075%
* Slippage: 1 tick
* No margin/leverage used
ProfitView Strategy TemplateHello traders,
This script took me a full week of coding/testing, sweat, and tears - and I’m too nice as I’m giving it for free to the community.
If you're tired of manual trading and looking for a solid strategy template to pair with your indicators, look no further.
This Pine Script v5 strategy template is engineered for maximum customization and risk management.
Best part?
This Pine Script v5 template facilitates the dynamic construction of ProfitView alerts, sparing users the time and effort of mastering the ProfitView syntax and manually creating alert commands.
This powerful tool gives much power to those who don't know how to code in Pinescript and want to automate their indicators' signals via the ProfitView Chrome extension.
IMPORTANT NOTES
ProfitView is a trading bot software that forwards TradingView alerts to your brokers (examples: Binance, Oanda, Coinbase, Bybit, etc.) for automating trading.
Many traders don't know how to dynamically create ProfitView-compatible alerts using the data from their TradingView scripts.
Traders using trading bots want their alerts to reflect the stop-loss/take-profit/trailing-stop/stop-loss to break options from your script and then create the orders accordingly.
This script showcases how to create ProfitView alerts dynamically.
TRADINGVIEW ALERTS
1) You'll have to create one alert per asset X timeframe = 1 chart.
Example: 1 alert for EUR/USD on the 5 minutes chart, 1 alert for EUR/USD on the 15-minute chart (assuming you want your bot to trade the EUR/USD on the 5 and 15-minute timeframes)
2) Select the Order fills and alert() function calls condition
3) For each alert, the alert message is pre-configured with the text below
{{strategy.order.alert_message}}
Please leave it as it is.
It's a TradingView native variable that will fetch the alert text messages built by the script.
4) ProfitView doesn't use webhook technology, so setting a webhook URL from the alerts notifications tab is unnecessary.
KEY FEATURES
I) Modular Indicator Connection
* plug your existing indicator into the template.
* Only two lines of code are needed for full compatibility.
Step 1: Create your connector
Adapt your indicator with only 2 lines of code and then connect it to this strategy template.
To do so:
1) Find in your indicator where the conditions print the long/buy and short/sell signals.
2) Create an additional plot as below
I'm giving an example with a Two moving averages cross.
Please replicate the same methodology for your indicator, whether a MACD , ZigZag, Pivots , higher-highs, lower-lows or whatever indicator with clear buy and sell conditions.
//@version=5
indicator("Supertrend", overlay = true, timeframe = "", timeframe_gaps = true)
atrPeriod = input.int(10, "ATR Length", minval = 1)
factor = input.float(3.0, "Factor", minval = 0.01, step = 0.01)
= ta.supertrend(factor, atrPeriod)
supertrend := barstate.isfirst ? na : supertrend
bodyMiddle = plot(barstate.isfirst ? na : (open + close) / 2, display = display.none)
upTrend = plot(direction < 0 ? supertrend : na, "Up Trend", color = color.green, style = plot.style_linebr)
downTrend = plot(direction < 0 ? na : supertrend, "Down Trend", color = color.red, style = plot.style_linebr)
fill(bodyMiddle, upTrend, color.new(color.green, 90), fillgaps = false)
fill(bodyMiddle, downTrend, color.new(color.red, 90), fillgaps = false)
buy = ta.crossunder(direction, 0)
sell = ta.crossunder(direction, 0)
//////// CONNECTOR SECTION ////////
Signal = buy ? 1 : sell ? -1 : 0
plot(Signal, title = "Signal", display = display.data_window)
//////// CONNECTOR SECTION ////////
Important Notes
🔥 The Strategy Template expects the value to be exactly 1 for the bullish signal and -1 for the bearish signal
Now, you can connect your indicator to the Strategy Template using the method below or that one.
Step 2: Connect the connector
1) Add your updated indicator to a TradingView chart
2) Add the Strategy Template as well to the SAME chart
3) Open the Strategy Template settings, and in the Data Source field, select your 🔌Connector🔌 (which comes from your indicator)
Note it doesn’t have to be named 🔌Connector🔌 - you can name it as you want - however, I recommend an explicit name you can easily remember.
From then, you should start seeing the signals and plenty of other stuff on your chart.
🔥 Note that whenever you update your indicator values, the strategy statistics and visuals on your chart will update in real-time
II) BOT Risk Management:
- Max Drawdown:
Mode: Select whether the max drawdown is calculated in percentage (%) or USD.
Value: If the max drawdown reaches this specified value, set a value to halt the bot.
- Max Consecutive Days:
Use Max Consecutive Days BOT Halt: Enable/Disable halting the bot if the max consecutive losing days value is reached.
- Max Consecutive Days: Set the maximum number of consecutive losing days allowed before halting the bot.
- Max Losing Streak:
Use Max Losing Streak: Enable/Disable a feature to prevent the bot from taking too many losses in a row.
- Max Losing Streak Length: Set the maximum length of a losing streak allowed.
Margin Call:
- Use Margin Call: Enable/Disable a feature to exit when a specified percentage away from a margin call to prevent it.
Margin Call (%): Set the percentage value to trigger this feature.
- Close BOT Total Loss:
Use Close BOT Total Loss: Enable/Disable a feature to close all trades and halt the bot if the total loss is reached.
- Total Loss ($): Set the total loss value in USD to trigger this feature.
Intraday BOT Risk Management:
- Intraday Losses:
Use Intraday Losses BOT Halt: Enable/Disable halting the bot on reaching specified intraday losses.
Mode: Select whether the intraday loss is calculated in percentage (%) or USD.
- Max Intraday Losses (%): Set the value for maximum intraday losses.
Limit Intraday Trades:
- Use Limit Intraday Trades: Enable/Disable a feature to limit the number of intraday trades.
- Max Intraday Trades: Set the maximum number of intraday trades allowed.
Restart Intraday EA:
- Use Restart Intraday EA: Enable/Disable a feature to restart the bot at the first bar of the next day if it has been stopped with an intraday risk management safeguard.
III) Order Types and Position Sizing
- Choose between market, limit, or stop orders.
- Set your position size directly in the template.
Please use the position size from the “Inputs” and not the “Properties” tab.
I know it's redundant. - the template needs this value from the "Inputs" tab to build the alerts, and the Backtester needs it from the "Properties" tab.
IV) Advanced Take-Profit and Stop-Loss Options
- Choose to set your SL/TP in either pips or percentages.
- Option for multiple take-profit levels and trailing stop losses.
- Move your stop loss to break even +/- offset in pips for “risk-free” trades.
V) Miscellaneous
Retry order openings if they fail.
Order Types:
Select and specify order type and price settings.
Position Size:
Define the type and size of positions.
Leverage:
Leverage settings, including margin type and hedge mode.
Session:
Limit trades to specific sessions.
Dates:
Limit trades to a specific date range.
Trades Direction:
Direction: Specify the market direction for opening positions.
VI) Notifications (Telegram/Discord/Email/IFTTT/Twilio/SMS)
Customize notifications sent to Telegram, Discord, Email, IFTTT, Twilio, and ProfitView Logger.
VII) Logger
The ProfitView commands are logged in the TradingView logger.
You'll find more information about it in this TradingView blog post .
WHY YOU MIGHT NEED THIS TEMPLATE
1) Transform your indicator into a ProfitView trading bot more easily than before
Connect your indicator to the template
Create your alerts
Set your EA settings
2) Save Time
Auto-generated alert messages for ProfitView.
I tested them all and checked with the support team what could/couldn’t be done.
3) Be in Control
Manage your trading risks with advanced features.
4) Customizable
Fits various trading styles and asset classes.
REQUIREMENTS
* Make sure you have your ProfitView account and do the settings correctly in your Chrome extension. If you don't know how to do it, read the documentation + ask for help in the ProfitView Discord support channel.
* If there is any issue with the template, ask me in the comments section - I’ll answer quickly.
BACKTEST RESULTS FROM THIS POST
1) I connected this strategy template to a dummy Supertrend script.
I could have selected any other indicator or concept for this script post.
I wanted to share an example of how you can quickly upgrade your strategy, making it compatible with ProfitView.
2) The backtest results aren't relevant for this educational script publication.
I used realistic backtesting data but didn't look too much into optimizing the results, as this isn't the point of why I'm publishing this script.
This strategy is a template to be connected to any indicator - the sky is the limit. :)
3) This template is made to take 1 trade per direction at any given time.
Pyramiding is set to 1 on TradingView.
The strategy default settings are:
* Initial Capital: 100000 USD
* Position Size: 1%
* Commission Percent: 0.075%
* Slippage: 1 tick
* No margin/leverage used
Best regards,
Dave
52W High / Low + 20% Retracement52-Week High / Low with 20% Retracement Level
This indicator provides a visual context for momentum and drawdown
analysis using 52-week price extremes.
What it shows:
- The 52-week high and 52-week low levels.
- A retracement level defined as a fixed percentage (default 20%)
below the 52-week high.
How to interpret it:
- Price above the retracement level indicates that the stock has
corrected in a controlled manner and the broader momentum structure
is still intact.
- Price below the retracement level suggests a deeper drawdown and
potential deterioration of momentum.
Intended use:
- Designed as a quality filter, not as an entry or exit signal.
- Helps identify stocks with strong momentum that are consolidating
rather than breaking down.
- Should be combined with trend and liquidity filters.
Notes:
- The retracement percentage is adjustable.
- This indicator is descriptive, not predictive.
- It does not replace risk management or stop-loss rules.
*/






















